package models

type EmailSend struct {
	Id    uint   `gorm:"column:id;primary_key;AUTO_INCREMENT" json:"id"`
	Bm    string `gorm:"column:bm" json:"bm"`
	Zw    string `gorm:"column:zw" json:"zw"`
	Email string `gorm:"column:email" json:"email"`
}

type FaxSend struct {
	Id   uint   `gorm:"column:id;primary_key;AUTO_INCREMENT" json:"id"`
	Name string `gorm:"column:name" json:"name"`
	Code string `gorm:"column:code" json:"code"`
}

type FtpSend struct {
	Id       uint   `gorm:"column:id;primary_key;AUTO_INCREMENT" json:"id"`
	Name     string `gorm:"column:name" json:"name"`
	Address  string `gorm:"column:address" json:"address"`
	Username string `gorm:"column:username" json:"username"`
}

type AlarmList struct {
	//Id   int    `gorm:"column:id;primary_key;AUTO_INCREMENT" json:"id"`
	//无符号整型
	Id   uint   `gorm:"column:id;primary_key;AUTO_INCREMENT" json:"id"`
	Name string `gorm:"column:name" json:"name"`

	IsSendEmail string      `gorm:"column:isSendEmail" json:"isSendEmail"`
	TargetEmail string      `gorm:"column:targetEmail" json:"targetEmail"`
	FormatEmail string      `gorm:"column:formatEmail" json:"formatEmail"`
	EmailSends  []EmailSend `gorm:"many2many:alarm_email_send;" json:"emailSends"`

	IsSendFax string    `gorm:"column:isSendFax" json:"isSendFax"`
	TargetFax string    `gorm:"column:targetFax" json:"targetFax"`
	FormatFax string    `gorm:"column:formatFax" json:"formatFax"`
	FaxSends  []FaxSend `gorm:"many2many:alarm_fax_send;" json:"faxSends"`

	IsSendFtp string    `gorm:"column:isSendFtp" json:"isSendFtp"`
	TargetFtp string    `gorm:"column:targetFtp" json:"targetFtp"`
	FormatFtp string    `gorm:"column:formatFtp" json:"formatFtp"`
	FtpSends  []FtpSend `gorm:"many2many:alarm_ftp_send;" json:"ftpSends"`
	Region    string    `gorm:"column:region" json:"region"`
}

type RegionList struct {
	BaseModel
	Name   string `gorm:"column:name" json:"name"`
	Target string `gorm:"column:target" json:"target"`
}

type TideHour struct {
	BaseModel
	Date    string `json:"date" gorm:"column:date;size:255;uniqueIndex:idx_date_time_station"`
	Time    string `json:"time" gorm:"column:time;size:255;uniqueIndex:idx_date_time_station"`
	Tide    string `json:"tide" gorm:"column:tide"`
	Station string `json:"station" gorm:"column:station;size:255;uniqueIndex:idx_date_time_station"`
}

type MessageSend struct {
	Id   uint   `gorm:"column:id;primary_key;AUTO_INCREMENT" json:"id"`
	Name string `gorm:"column:name" json:"name"`
	Code string `gorm:"column:code" json:"code"`
}

//	{
//	   "userCode": "KLAdN7oxeBY=",
//	   "password": "3b6e4cc1c07435df61207d5a97663382",
//	   "unixtick": "1706085197"
//	}
type MessageUser struct {
	UserCode string `json:"userCode"`
	Password string `json:"password"`
	Unixtick string `json:"unixtick"`
	Phone    string `json:"phone"`
}

//{
//    "code": "000000",
//    "message": "调用成功",
//    "result": {
//        "token": "GnDX/pvyeJX4Ln3oTs+/rHVtKirclYrNsRw2F6zaHRLNSMYuoEnyG9xAHW5k7qrw325xCGyGXvV7ZoFG9IlhVF6rcM2wmYEywkgeH1xgFzk=.b70cf7080b1468ec0c890cb332bd00e1",
//        "serverTime": "2024-01-24 15:50:32",
//        "expireTime": "2024-01-24 16:00:32"
//    }
//}

type TokenRes struct {
	Code    string `json:"code"`
	Message string `json:"message"`
	Result  struct {
		Token      string `json:"token"`
		ServerTime string `json:"serverTime"`
		ExpireTime string `json:"expireTime"`
	} `json:"result"`
}

// {
//  "token": "GnDX/pvyeJXhCTYJQ+1V/92+prsd/L73zGgS3977L7KEaRJKBjDldyahI+UWSSjP2moMdQqgsFpkBszbOiY5j7YC7oe2xlK7CQkvJPHrq6M=.f27fa6532dbba9a6c39a5cfbbcb920f7",
//  "details": [
//    {
//      "receiveNumber": "19952408887",
//      "transactionId": "yxttest-00001"
//    },
//    {
//      "receiveNumber": "19952408888",
//      "transactionId": "yxttest-00002"
//    }
//  ],
//  "atTime": "",
//  "routeName": "",
//  "isSame": true,
//  "sameContent": "【音信通】您选购了2件，单价为100元，总价格为200元，验证码为12345，不要将验证码告诉别人。",
//  "isReceipt": false,
//  "needMO": false
//}

type Details struct {
	ReceiveNumber string `json:"receiveNumber"`
	TransactionId string `json:"transactionId"`
}

type MessageSendReq struct {
	Token       string    `json:"token"`
	Details     []Details `json:"details"`
	AtTime      string    `json:"atTime"`
	RouteName   string    `json:"routeName"`
	IsSame      bool      `json:"isSame"`
	SameContent string    `json:"sameContent"`
	IsReceipt   bool      `json:"isReceipt"`
	NeedMO      bool      `json:"needMO"`
}

type TideHourNew struct {
	BaseModel
	Date     string `json:"date" gorm:"column:date;size:255;uniqueIndex:idx_date_time_station"`
	Time     string `json:"time" gorm:"column:time;size:255;uniqueIndex:idx_date_time_station"`
	Tide     string `json:"tide" gorm:"column:tide"`
	Station  string `json:"station" gorm:"column:station;size:255;uniqueIndex:idx_date_time_station"`
	SaveDate string `json:"saveDate" gorm:"column:saveDate"`
}
